//
//  FRQAccountSecurityViewController.m
//  FRQBluetoothKit_Example
//
//  Created by admin on 2023/10/24.
//  Copyright © 2023 xuchunhai. All rights reserved.
//

#import "FRQAccountSecurityViewController.h"
#import "FRQEmailViewController.h"
#import "AccountSecurityViews.h"
#import "FRQChangePasswordViewController.h"
#import "FRQDeleteAccountViewController.h"
@interface FRQAccountSecurityViewController ()
@property (nonatomic,strong) AccountSecurityViews *AccountSecurityView;
@end

@implementation FRQAccountSecurityViewController
- (AccountSecurityViews *)AccountSecurityView{
    if (nil==_AccountSecurityView) {
        _AccountSecurityView=skXibView(@"AccountSecurityViews");
        [self.view addSubview:_AccountSecurityView];
        [_AccountSecurityView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self.mas_topLayoutGuide);
            make.bottom.mas_equalTo(self.mas_bottomLayoutGuide);
            make.right.left.mas_equalTo(0);
        }];
        @weakify(self)
        [[_AccountSecurityView.btnEmail rac_signalForControlEvents:(UIControlEventTouchUpInside)] subscribeNext:^(__kindof UIControl * _Nullable x) {
            @strongify(self)
            FRQEmailViewController *view=[[FRQEmailViewController alloc] init];
            [self.navigationController pushViewController:view animated:YES];
        }];
        [[_AccountSecurityView.btnPassword rac_signalForControlEvents:(UIControlEventTouchUpInside)] subscribeNext:^(__kindof UIControl * _Nullable x) {
            @strongify(self)
            FRQChangePasswordViewController *view=[[FRQChangePasswordViewController alloc] init];
            [self.navigationController pushViewController:view animated:YES];
        }];
        [[_AccountSecurityView.btnDeleteAccount rac_signalForControlEvents:(UIControlEventTouchUpInside)] subscribeNext:^(__kindof UIControl * _Nullable x) {
            @strongify(self)
            FRQDeleteAccountViewController *view=[[FRQDeleteAccountViewController alloc] init];
            view.modalPresentationStyle=0;
            [self presentViewController:view animated:YES completion:^{
                
            }];
        }];
    }
    return _AccountSecurityView;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.title=@"Account Security";
    self.AccountSecurityView.hidden=NO;
    if(KuserType!=0){
        self.AccountSecurityView.viewDelect.hidden=YES;
    }
    // Do any additional setup after loading the view.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
